package modelo.hibernate.dao;
import java.util.ArrayList;

import java.util.List;
import modelo.hibernate.config.Sesion;
import org.hibernate.Session;
import org.hibernate.Transaction;
import modelo.entidad.*;

public class DaoPago {
	private Sesion sesionPostgres;
	
	public void agregarPago(Pago dato) throws Exception{
		@SuppressWarnings("static-access")
		Session em = sesionPostgres.openSession();  
         Transaction tx = null;  
         try {    
        	 tx = em.beginTransaction();
              em.save( dato);   
              tx.commit();  
         } catch (Exception e) {  
             tx.rollback();            
             e.printStackTrace();
             throw e;
         } finally {  
             em.close();  
         } 
	}
	
}
